#include "KinectReader.h"
#include "Renderer.h"
#include "SkeletonGenerator.h"

#define NUM_GENERATED_SKELETONS 1

SkeletonGenerator * generator;

void waitForData() {
	if(Renderer::TEST_WITH_KINECT) {
		KinectReader::getInstance()->updateSkeletonData();
		Renderer::getInstance()->setSkeleton(KinectReader::getInstance()->getSkeletons());
	} else {
		Renderer::getInstance()->setSkeleton(generator->getSkeletons());
	}
}


int main(int argc, char **argv)
{
	
	if(Renderer::TEST_WITH_KINECT) {
		// initialize kinect reader
		KinectReader::getInstance();
	} else {
		generator = new SkeletonGenerator(NUM_GENERATED_SKELETONS);
	}

	// initialize renderer
	Renderer::getInstance()->init(argc, argv);
	Renderer::getInstance()->setIdleFunction(waitForData);
	Renderer::getInstance()->beginRenderingLoop();


	return 0;
}

